package com.spring.demo7.eg4;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;

/**
 * @author vhans
 */
@Configuration
@Lazy
public class MainConfig3 {
    @Bean
    public String name() {
        System.out.println("create name");
        return "Vhans";
    }

    @Bean
    public String address() {
        System.out.println("create address");
        return "嘉兴市";
    }

    @Bean
    @Lazy(value = false)
    public Integer age() {
        System.out.println("create age");
        return 20;
    }
}
